
import * as React from "react";
import {connect} from "react-redux";
import {DemoService, IDemoService} from "@/core/services/DemoService";
import {Inject} from "@/core/base/inject";
import {StoreState} from "@/store";

export interface IPropsDemo extends IDemoService{}

class Demo  extends React.Component<IPropsDemo, any>{

    @Inject("DemoService") demoService:DemoService;

    componentDidMount(): void {
        this.demoService.changeMinWindow("2222222")
    }

    render(){
        const {name} = this.props;
        return (
            <div>
                {name}
            </div>
        )
    }
}

export const mapStateToProps = (state:StoreState):IPropsDemo => ({
    name:state.DemoService.name
});

export default connect(mapStateToProps)(Demo);
